package com.syni.mdd.sjb.common.datatreaure.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.DxshAppIndustryChild;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.mapper.DxshAppIndustryChildMapper;
import com.syni.mdd.sjb.common.datatreaure.service.DxshAppIndustryChildService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 电享生活行业表 服务实现类
 * </p>
 *
 * @author lcc
 * @since 2020-10-28
 */
@Service
public class DxshAppIndustryChildServiceImpl extends ServiceImpl<DxshAppIndustryChildMapper, DxshAppIndustryChild> implements DxshAppIndustryChildService {
    @Override
    public Map<Integer, DxshAppIndustryChild> getMapByIds(Set<Integer> chooseMinIndustryIds) {
        Map<Integer,DxshAppIndustryChild> dxshAppIndustryChildMap = new HashMap<>();
        List<DxshAppIndustryChild> dxshAppIndustryChildrens = this.listByIds(chooseMinIndustryIds);
        if(CollectionUtils.isNotEmpty(dxshAppIndustryChildrens)){
            dxshAppIndustryChildrens.forEach(dc -> {
                dxshAppIndustryChildMap.put(dc.getId(),dc);
            });
        }
        return dxshAppIndustryChildMap;
    }
}
